package ui.model;

import java.util.ArrayList;

import javax.swing.DefaultComboBoxModel;

import exceptions.DatabaseErrorException;
import exceptions.PasIdentificationException;

import appControll.AppController;
import model.*;

public class OrderStatusComboBoxModel extends DefaultComboBoxModel {
	private ArrayList<OrderStatus> ordStatList;
	private AppController app = AppController.getUniqueInstance();
	
	public OrderStatusComboBoxModel() throws PasIdentificationException, DatabaseErrorException{
		ordStatList = app.getAllOrderStatus();
		for(OrderStatus o: ordStatList){
			this.addElement(o.getOrderStatus_verbose());
		}
	}
	public OrderStatus getOrderStatus(int i){
		return ordStatList.get(i);
	}
	public void addOrderStatus(OrderStatus o){
		ordStatList.add(o);
		this.addElement(o.getOrderStatus_verbose());
	}
}
